project(mediasoup-server)

file(GLOB ${PROJECT_NAME}_SRC
        ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cc
        ${CMAKE_CURRENT_SOURCE_DIR}/*/*/*.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/*/*/*.cc
)

add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SRC})

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

if (WIN32)
    target_compile_definitions(${PROJECT_NAME} PRIVATE NOMINMAX)
endif ()
target_link_libraries(${PROJECT_NAME} PRIVATE libmediasoup sigslot)

find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json)

find_package(oatpp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp)

find_package(oatpp-websocket CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-websocket)

#查找openssl是否安装
find_package(OpenSSL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::Crypto)

find_package(oatpp-openssl CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-openssl)

find_package(oatpp-swagger CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-swagger)

find_package(asio CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE asio::asio)

find_package(unofficial-concurrentqueue CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::concurrentqueue::concurrentqueue)